package com.hissy.common.design.create.singleton;

/**
 * Created by zhangyanfei on 2019/4/4.
 * 饿汉式   登记式单例(可忽略)
 *
 * @author zhangyanfei
 * @date 2019/04/04
 */
public class Singleton2 {
    private Singleton2() {}

    /**
     * jvm机制 常量只创建一次 保证单例
     */
    private static final Singleton2 single = new Singleton2();

    public static Singleton2 getInstance() {
        return single;
    }

}
